package sjtu.ist.warehouse4ws.service.cust;

import java.util.ArrayList;
import java.util.List;

import sjtu.ist.warehouse4ws.dao.ColumnValueDaoHibernate;
import sjtu.ist.warehouse4ws.dao.cust.CustColumnValueDaoHibernate;
import sjtu.ist.warehouse4ws.model.ColumnValue;
import sjtu.ist.warehouse4ws.model.CustColumnValue;

public class CustColumnValueServiceImpl implements CustColumnValueService{
	CustColumnValueDaoHibernate custColumnValueDao;
	ColumnValueDaoHibernate columnValueDao;

	public void setCustColumnValueDao(CustColumnValueDaoHibernate custColumnValueDao) {
		this.custColumnValueDao = custColumnValueDao;
	}

	public void setColumnValueDao(ColumnValueDaoHibernate columnValueDao) {
		this.columnValueDao = columnValueDao;
	}

	public List<ColumnValue> getByTable(String tablename){
		List<CustColumnValue> tlist = custColumnValueDao.getByTable(tablename);
		List<ColumnValue> list=new ArrayList<ColumnValue>();//columnValueDao.getByTable(tablename.substring(5));
		for(CustColumnValue cv : tlist){
			list.add((ColumnValue)cv);
		}
		return list;
	}
}
